# common settings with intel compilers
#use aggressive inlining
ADD_DEFINITIONS(-DADD_ -DINLINE_ALL=inline)

FIND_PATH(MKL_INCLUDE_DIR mkl.h ${MKL_HOME}/include)
INCLUDE_DIRECTORIES(${MKL_INCLUDE_DIR})

FIND_LIBRARY(LAPACK_LIBRARY NAMES mkl_lapack PATHS ${MKL_HOME}/lib/${MKL_EXT})
FIND_LIBRARY(BLAS_LIBRARY NAMES mkl PATHS ${MKL_HOME}/lib/${MKL_EXT})

MARK_AS_ADVANCED(
  LAPACK_LIBRARY 
  BLAS_LIBRARY 
)

SET(HAVE_SSE 1)
SET(HAVE_SSE2 1)
SET(HAVE_SSE3 1)
SET(HAVE_SSSE3 1)

SET(ENABLE_OPENMP 1)
if(${CMAKE_CXX_FLAGS} MATCHES "icpc")
  SET(HAVE_MPI 0)
  SET(HAVE_OOMPI 0)
else(${CMAKE_CXX_FLAGS} MATCHES "icpc")
  SET(HAVE_MPI 1)
  SET(HAVE_OOMPI 1)
endif(${CMAKE_CXX_FLAGS} MATCHES "icpc")

FIND_PATH(FFTW_INCLUDE_DIR fftw3.h)
FIND_LIBRARY(FFTW_LIBRARY fftw3)
IF(FFTW_INCLUDE_DIR)
  SET(FOUND_FFTW 1 CACHE BOOL "Found fftw library")
  SET(HAVE_LIBFFTW 1 CACHE BOOL "Found fftw library")
ELSE(FFTW_INCLUDE_DIR)
  SET(FOUND_FFTW 0 CACHE BOOL "Not Found fftw library")
ENDIF(FFTW_INCLUDE_DIR)

#MARK_AS_ADVANCED(
#   FFTW_INCLUDE_DIR
#   FOUND_FFTW
#)
